package edu.ustb.mis.dm.model.unit.impl;

import java.io.Serializable;
import java.util.BitSet;
import java.util.Set;

/**
 * CABOSFV聚类的算法的实例类 每个实例都有一个类标示和属性
 * 
 * @author Saya
 */
public class Instance implements Serializable {
	private static final long serialVersionUID = -9129318320607719964L;

	/**
	 * 用来存储每个实例的类别名称
	 */
	private String classID;

	/**
	 * 用来存储每个类的属性集合
	 */
	private BitSet attributes;

	private Set<Integer> attributeSet;

	public Instance() {
	}

	public Instance(final String classID, final BitSet attributes) {
		this.classID = classID;
		this.attributes = attributes;
	}

	public Instance(final String classID, final BitSet attributes, final Set<Integer> attributeSet) {
		this.classID = classID;
		this.attributes = attributes;
		this.attributeSet = attributeSet;
	}

	public BitSet getAttributes() {
		return attributes;
	}

	public Set<Integer> getAttributeSet() {
		return attributeSet;
	}

	public String getClassID() {
		return classID;
	}

	public void setAttributes(final BitSet attributes) {
		this.attributes = attributes;
	}

	public void setAttributeSet(final Set<Integer> attributeSet) {
		this.attributeSet = attributeSet;
	}

	public void setClassID(final String classID) {
		this.classID = classID;
	}

	@Override
	public String toString() {
		return classID + attributes.toString();
	}
}
